﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.services {
    import net.wooga.pets.events.*;
    import org.robotlegs.mvcs.*;
    import flash.external.*;

    public class ExtInterfaceService extends Actor {

        public function ExtInterfaceService(){
            if (ExternalInterface.available){
                ExternalInterface.addCallback("callFlash", this.callFlash);
            };
        }
        private function callFlash(_arg1:String, ... _args):Boolean{
            var info:InfoEvent;
            var id = _arg1;
            var args = _args;
            try {
                l(((("e CALL ME id: " + id) + " and the rest ") + args));
                info = new InfoEvent(id, null, args);
                dispatch(info);
                return (true);
            } catch(error:Error) {
                l(("e CALL FLASH ERROR: " + error.toString()));
            };
            return (false);
        }
        public function callJS(_arg1:String, _arg2:Array=null){
            var _local3:* = null;
            if (ExternalInterface.available){
                _arg2 = (_arg2) ? _arg2.concat() : [];
                _arg2.unshift(_arg1);
                _local3 = ExternalInterface.call.apply(null, _arg2);
            };
            return (_local3);
        }

    }
}//package net.wooga.pets.services 
